package com.example.xm.controller;

import com.example.xm.entity.Gedan;
import com.example.xm.entity.Yinyue;
import com.example.xm.service.IGedanService;
import com.example.xm.web.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/gedan")
public class GedanController {
@Autowired
   private IGedanService gedanService;
    @PostMapping("/add")
    public Result add(@RequestBody Gedan gedan) {
        gedanService.add(gedan);
        return Result.success();
    }
    @GetMapping("/list")
    public Result list(Integer uid) {
       List<Gedan> list= gedanService.list(uid);
        return Result.success(list);
    }
    @GetMapping("/getData")
    public Result getData(Integer id) {
        Gedan gedan= gedanService.getData(id);
        return Result.success(gedan);
    }
}
